/*
 * Answer.cpp
 *
 *  Created on: Dec 8, 2014
 *      Author: liuchen
 */

#include <iostream>

using namespace std;

class algoritm_answer {
public:
	int ones(int n) {
		if (n < 2)
			return n;
		return n % 2 + ones(n / 2);
	}
};


//int main() {
//
//	algoritm_answer alg;
//
//	cout << alg.ones(5) << endl;
//
//	return 0;
//}
